package com.hmdp.config;

import lombok.extern.slf4j.Slf4j;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 24040
 * @name RedissonConfig
 * @date 2022-11-13 12:09
 */
@Configuration
@Slf4j
public class RedissonConfig {
    @Bean
    public RedissonClient redissonClient(){
        //配置
        Config config = new Config();
        config.useSingleServer()
                .setAddress("redis://81.68.179.206:6379")
                .setPassword("Aa2404076468@");
        //创建redisson对象
        return Redisson.create(config);
    }
}
